import React from 'react';
import { observer, inject } from 'mobx-react';
import { withRouter } from 'react-router-dom';
import { PullToRefresh } from 'weaver-mobile';
import { toJS } from 'mobx';
import EntrancePage from '../../tabPages/entrance';

@inject('homePageTestStore')
@withRouter
@observer
export default class Home extends React.Component {
  render() {
    const { menuConfig, activeKey, onChange, showGroup, disableMenu, isMenuInited, getCorner } = this.props.homePageTestStore;
    return (
      <PullToRefresh
        style={{ height: '100%', overflow: 'auto' }}
        className="wm-menu-preview-pull-refresh"
        onRefresh={() => {
          // getWfCount();
          getCorner();
        }}
      >
        <EntrancePage
          menuConfig={toJS(menuConfig)}
          activeKey={toJS(activeKey)}
          onChange={onChange}
          disableMenu={disableMenu}
          isMenuInited={isMenuInited}
          showGroup={showGroup}>
        </EntrancePage>
      </PullToRefresh>
    );
  }
}

